<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<script src="${res_app}/js/app/kjt/dojo.js" type="text/javascript"></script>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">买方基本信息</div>
<table class="t_css table01" width="100%" border="0" cellpadding="0"
	cellspacing="1">
<col style="width:18%"/>
<col style="width:15%"/>
<col style="width:15%"/>
<col style="width:17%"/>
<col style="width:17%"/>
<col style="width:18%"/>
							<tr >
								<td nowrap>
									【买方名称】
								</td>
								<td colspan="5">
								
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/cname"/>
								</td>
							</tr>
							<tr >
							<td  nowrap>
									【法定代表人】
								</td>
								<td >
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/legel_rep_cname"/>
								</td>
								<td nowrap>
									【组织机构证代码/<br/>统一社会信用代码】
								</td>
								<td >
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/org_no" />
									<%-- <x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/org_code1"/><x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/org_code2"/> --%>
								</td>
								<td nowrap>
									【税务登记号】
								</td>
								<td>
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/swdjh"/>
								</td>			
							<%-- 	<td nowrap>
									【买方国别或地区】<span class="color_red">*</span>
								</td>
								<td>
									<c:set var="buycountry" scope="page"><x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/@country" /></c:set>
									<input type="text"  name="organizations/organization[1]@country_name" id="organizations/organization[1]@country_name" type=text  style="TEXT-ALIGN: center" readonly value="<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/@country_name"/>">
									<input type="hidden" name="organizations/organization[1]@country" id="organizations/organization[1]@country" type=text  style="TEXT-ALIGN: center" readonly value="<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/@country"/>">
									<a href="#"><IMG border=0 onclick="xmlSelect('CountryType');isShowDq('1');" src="/stmsres/images/arrow.gif" width="16" height="16"></a>
								</td> --%>
							</tr>
							<tr>
								<td nowrap>
									【国别代码】
								</td>
								<td colspan="1">
						
								<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/country_name"/>
							
								</td>
							<td nowrap>
									【行政区划代码】
								</td>
								<td colspan="3">
							<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/area_name"/>
							
								<!-- 	<input type="hidden" name='organizations/organization[1]@country' id='organizations/organization[1]@country' value="142"  height: 21">
									<span name="organizations/organization[1]@country_name" id="organizations/organization[1]@country_name"> 四川省 成都市 </span>
 -->
 								<%-- 	<input type="hidden" name="organizations/organization[1]/area_no" id="organizations/organization[1]/area_no" value="">
									<input type="text" name="organizations/organization[1]/area_no_name" id="organizations/organization[1]/area_no_name" style="width: 360; height: 21" readonly style="TEXT-ALIGN: center" value="四川省">
									<a href="#"><IMG border=0 onclick="getFenLeiForm('organizations/organization[1]@area_no');" src="${res_app }/images/arrow1.gif" width="16" height="16"></a>
									
									<input type="hidden" id="areaValue" value="123">
									<input type="hidden" id="areaValue_name" value="123"> --%>
								</td>
					
							</tr>

							<tr >
								<td nowrap>
									【注册地址】
								</td>
								<td colspan="3">
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/address"/>
								</td>
								<td nowrap>
									【邮政编码】
								</td>
								<td >
								<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/zip_code"/>
								</td>
							</tr>
						
							<tr >						
								<td nowrap >
									【联系人】
								</td>
								<td >
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/lxr"/>
								</td>
								<td>
									【联系电话】
								</td>
								<td>
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/lxr_tel"/>
								</td>
								<td>
									【电子邮件】
								</td>
								<td>
									<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/lxr_email"/>
								
								</td>
							</tr>
							<tr><td nowrap>
									【机构从事的国民经济行业】
								</td>
								<td nowrap>
								
									<x:out select="$xmlData/data/proposal/gmjjhy_name" />
											
								</td>
									<td nowrap>
									【买方性质】
								</td>
								<td  colspan="1">
								<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/nature_type_name"/>
								
								</td>
									<td nowrap>
									【国家技术转移示范机构】
								</td>
								<td >
							<x:out select="$xmlData/data/proposal/is_gjjszysfjg_name" />
							
								
								</td>
							</tr>
							<tr>
							<td nowrap>
									【企业规模】
								</td>
								<td>
								<x:out select="$xmlData/data/organizations/organization/qygm_name" />
							
								</td>
								<td nowrap>
									【高新技术企业】
								</td>
								<td>
								
										<x:out select="$xmlData/data/proposal/is_gxjsqy_name" />
							
									
								</td>
								<td nowrap>
									【211大学】
								</td>
								<td>
									<x:out select="$xmlData/data/proposal/is_211dx_name" />
							
									
								
								</td>
							</tr>
							<c:set var="nature_type"><x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/nature_type"/></c:set>
							<c:set var="nature_type_all"><x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/nature_type"/></c:set>
							<c:set var="nature_type" value="${fn:substring(nature_type, 0, 4)}" />
							<tr <c:if test="${nature_type !='0602'}"> style="display:none" </c:if>>
							
							<td nowrap>
									【是否研发机构】
								</td>
								<td>
									<x:out select="$xmlData/data/proposal/is_yfjg_name" />
							
								
								</td>
									<td nowrap>
									【是否转制科研院所】
								</td>
								<td colspan="3">
										<x:out select="$xmlData/data/proposal/is_zzkyys_name" />
							
								
								</td>
							
								</tr>
							<tr <c:if test="${nature_type !='0604' && nature_type !='0601' && nature_type !='0603' && nature_type !='0606'}"> style="display:none" </c:if>>
							
							<td nowrap>
									【是否研发机构】
								</td>
								<td>
									<x:out select="$xmlData/data/proposal/is_yfjg_name" />
							
								</td>
									<td nowrap <c:if test="${(nature_type=='0601' || nature_type=='0603' || nature_type=='0606') && nature_type_all != '060602'}">style="display:none"</c:if>>
									【是否转制科研院所】
								</td>
								<td colspan="3" <c:if test="${(nature_type=='0601' || nature_type=='0603' || nature_type=='0606') && nature_type_all != '060602'}">style="display:none"</c:if>>
										<x:out select="$xmlData/data/proposal/is_zzkyys_name" />
							
								
								</td>
							
								</tr>
							<tr>
								<td nowrap>
									【是否国家级高新区内企业】
								</td>
								<td>
								<x:out select="$xmlData/data/proposal/is_gjjgxqnqy_name" />
							
									
								</td>
								
								<td nowrap>
								<c:set var="is_gjjgxqnqy_value"><x:out select="$xmlData/data/proposal/is_gjjgxqnqy_value" /></c:set>
									<SPAN  <c:if test="${is_gjjgxqnqy_value!='01' }"> style="display:none"  </c:if>>【所属园区】</SPAN>
								</td>
								<td colspan="3" >
								 <c:if test="${is_gjjgxqnqy_value=='01' }"> 
							<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/park_name"/></c:if>
								
								</td>

							</tr>
							<tr>
							<td nowrap>
									【是否技术转移机构】
								</td>
								<td>
									<x:out select="$xmlData/data/proposal/is_jszyjg_name" />
							
							
								
								</td>								
								<td nowrap >
								<c:set var="is_jszyjg_value"><x:out select="$xmlData/data/proposal/is_jszyjg_value" /></c:set>
									<span <c:if test="${is_jszyjg_value!='01' }">   style="display:none" </c:if> >【主营业务】</span>
									
									</td>
									<td >
									<c:if test="${is_jszyjg_value=='01' }"> 
										<x:out select="$xmlData/data/proposal/is_jszyjglx_name" />
									</c:if>
									</td>
									<td nowrap>
									<c:set var="is_jszyjglx_value"><x:out select="$xmlData/data/proposal/is_jszyjglx_value" /></c:set>
									<span <c:if test="${is_jszyjglx_value!='460108' }"> style="display:none"</c:if>>【技术转移机构类型】</span>	&nbsp;
								</td>
								<td >
								<c:if test="${is_jszyjglx_value=='460108' }">
								<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/other"/>
								</c:if>
								</td>
							</tr>
							<c:set var="nature_type"><x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/nature_type"/></c:set>
								<c:set var="nature_type" value="${fn:substring(nature_type, 0, 4)}" />
							<tr <c:if test="${nature_type !='0604'  }"> style="display:none" </c:if> >
							<td nowrap>
									【是否上市公司】
								</td>
								<td >
								<x:out select="$xmlData/data/proposal/is_public_company_name" />
								
								</td>								
								<td >
								<c:set var="is_public_company_value"><x:out select="$xmlData/data/proposal/is_public_company_value" /></c:set>
									<span  <c:if test="${is_public_company_value!='01' }">  style="display:none"</c:if> >【证券代码】</span>&nbsp;
								</td>
								<td colspan="3">
							<c:if test="${is_public_company_value=='01' }"> 
								<x:out select="$xmlData/data/organizations/organization[@sequence_no='2']/security"/>
								</c:if>
								</td>
							</tr>
						
</table>
<script type="text/javascript">
	function xmlSelect(str){
			//window.showModalDialog("jsp/xmlSelect/xmltree.jsp?str="+str,window,'');
			window.open(ctx+'/ajax/toXmlSelect?str='+str,'','resizable=no,height=600,width=250,scrollbars=yes,status=yes,left=550,top=250');
		//window.open(ctx+'/ajax/toXmlSelect?str='+str,'dialogWidth:200px;dialogHeight:600px;dialogLeft:750;dialogTop:150;status:no;help:no');
	}
	
	function TreeBackVal(res,type){
		if(type=="ContractType"){
		document.getElementById("prp_base_info/ctr_type1").value=res.txt1;
		document.getElementById("prp_base_info/ctr_type_code").value=res.val1;
		}
		if(type=="ProgramType"){
			document.getElementById("plan_source1").value=res.txt1;
			document.getElementById("plan_source_code").value=res.val1;
			var programType=$("#plan_source_code").val().substr(0,2);
			if(programType=='01'){
				$("#reg_no1").css('display','');
				$("#reg_no2").css('display','');
				$("#sub_name").addClass("required");
				$("#sub_code").addClass("required");
				//$("#reg_no").addClass("required");
			}else{
				$("#reg_no1").css('display','none');
				$("#reg_no2").css('display','none');
				$("#sub_name").removeClass("required");
				$("#sub_code").removeClass("required");
				//$("#reg_no").removeClass("required");
				$("#sub_name").val('');
				$("#sub_code").val('');
				$("#reg_no").val('');
			}
		}
		if(type=="KnowType"){
		document.getElementById("kr_no1").value=res.txt1;
		document.getElementById("kr_no_code").value=res.val1;
			var knowType=$("#kr_no_code").val().substr(0,2);
			if(knowType=='02'){
				$("#zlsl1").css('display','');
				$("#zlsl2").css('display','');
				$("#zlsl").addClass("required");
				$("#zlsa").addClass("required");
				$("#zlsb").addClass("required");
				$("#zlsc").addClass("required");
				
			}else{
				$("#zlsl1").css('display','none');
				$("#zlsl2").css('display','none');
				$("#zlsl").removeClass("required");
				$("#zlsa").removeClass("required");
				$("#zlsb").removeClass("required");
				$("#zlsc").removeClass("required");
				$("#zlsl").val('');
				$("#zlsa").val('');
				$("#zlsb").val('');
				$("#zlsc").val('');
		}
		
		}
		if(type=="TechnologyType"){
		document.getElementById("prp_base_info/tech_area1").value=res.txt1;
		document.getElementById("prp_base_info/tech_area_code").value=res.val1;
		
		
		}
		if(type=="SellerType"){
		document.getElementById("organizations/organization[1]/nature_type_name").value=res.txt1;
		document.getElementById("organizations/organization[1]/nature_type").value=res.val1;
		
		
		}
		if(type=="Area"){
		document.getElementById("organizations/organization[1]/area_no_name").value=res.txt1;
		document.getElementById("organizations/organization[1]/area_no").value=res.val1;
		
		
		}
		if(type=="CountryType"){
		document.getElementById("country_name").value=res.txt1;
		document.getElementById("country").value=res.val1;
		
		
		}
		if(type=="ParkType"){
			document.getElementById("is_gjjgxqnqy4").value=res.txt1;
			document.getElementById("is_gjjgxqnqy3").value=res.val1;
			
			
			}
		if(type=="ParkType1"){
			document.getElementById("is_gjjgxqnqy14").value=res.txt1;
			document.getElementById("is_gjjgxqnqy13").value=res.val1;
			
			
			}
		}
	function getFenLeiForm(objId)
	{
		var txt_1 = dojo.byId(objId);
		var txt_1_name = dojo.byId(objId+"_name");
		var url = "";
		if( txt_1.value != "" )
		{
			alert(txt_1.value);
			url = ctx+"/ajax/typeData?DataType=BuyerSiteData&cmd=edit&nodeId="+txt_1.value;
		}
		else
		{
			url = ctx+"/ajax/typeData?DataType=BuyerSiteData&cmd=open&nodeId="+txt_1.value;
		}
		
		
		var result = window.open(url,"obj","height:500px;left:(screen.width/2)px;top:(screen.height/2)px;width:400px;center:yes;resizable:no;status:no;");

		if(result == undefined){
			result = window.returnValue;
		}

		if( result )
		{
			txt_1.value = result[0];
			txt_1_name.value = result[1];
		}
		else
		{
			
		}

	}
	function setvalue(obj,item) {	
		var zyyw="";
		for(var i=0;i<2;i++) {
			if(document.getElementById("organizations/organization["+i+"]@"+obj).value==1||document.getElementById("organizations/organization["+i+"]@"+obj).value==8) {
				if(i==0){
					if(item=="zyyw")
					    zyyw=document.getElementById("organizations/organization["+i+"]@"+item).value
					for(var j=1;j<3;j++) {
						var tbl = document.getElementById("sell"+item+j);			
						tbl.style.display="";	
						var tbl2 = document.getElementById("sellqt"+j);	
						if(zyyw=='08'&&tbl.style.display=="")
							tbl2.style.display="";
					}
				}else{
					if(item=="zyyw")
						zyyw=document.getElementById("organizations/organization["+i+"]@"+item).value
					for(var k=1;k<3;k++){
						var tbl = document.getElementById("buy"+item+k);			
						tbl.style.display="";	
						var tbl2 = document.getElementById("buyqt"+k);	
						if(zyyw=='08'&&tbl.style.display=="")
							tbl2.style.display="";
					}
				}
			}
		}
	}
	function CalBudgetLoop(calex,itemtitle,itemend)
	{
		
		var total = calex.substring(0,calex.indexOf("="));
		var arrTmp = calex.substring(calex.indexOf("=")+1,calex.length).split("+");

		var totalnum = 0;

		for(var i=0;i<arrTmp.length;i++)
		{
			var obj = document.getElementsByName(itemtitle + arrTmp[i] + itemend);
			totalnum = totalnum + calItemNum(obj[0]);
		}
		
		var total_obj = document.getElementsByName(itemtitle + total + itemend);
		total_obj[0].value = BitFormat(totalnum);
		Format(total_obj[0]);
	}

	<c:if test="${param.Action == 'view'}">
			clearPrpGetInfoFlag();
	</c:if>
	
	function isChina(){
	name=document.getElementById("organizations/organization[1]/country_name").value;
	if(name!='中国'&&name!='台湾')
	alert("买方国别为外国不能填写买方地区");
	
	}
	$(function(){
		//var temp = $("#is_gjjgxqnqy_value").val();
			setZQDMtatus('is_gjjgxqnqy');
			setZQDMtatus('is_jszyjg');
			setZQDMtatus('is_jszyjglx');
			setZQDMtatus('is_jszyjg_my');
			setZQDMtatus('is_jszyjg_mylx');
			setZQDMtatus('is_public_company');
			setZQDMtatus('is_public_company1');
			setZQDMtatus('is_gjjgxqnqy1');
	});
	function setZQDMtatus(obj)
	{			
		if(obj=="seller")
		{
			
			var id = document.getElementById("organizations/organization[0]/is_public_company").value;	
			if(id==1){
				for(var i=1;i<3;i++){
					var tbl = document.getElementById("sellzqdm"+i);			
					tbl.style.display="";				
				}
			}else{			
				for(var i=1;i<3;i++){
				var tbl = document.getElementById("sellzqdm"+i);			
				tbl.style.display="none";					
			}
			}
		}else if(obj=="is_public_company"){
			var value=$("#"+obj+"_value").val();
			if(value=='01'){
				$("#"+obj+"2").css("display",'');
				$("#"+obj+"3").css("display",'');
				$("#security").addClass("required");
				
			}else{
				$("#"+obj+"2").css("display",'none');
				$("#"+obj+"3").css("display",'none');
				$("#security").removeClass("required");
				$("#security").val('');
			}
		}else if(obj=="is_public_company1"){
			var value=$("#"+obj+"_value").val();
			if(value=='01'){
				$("#"+obj+"2").css("display",'');
				$("#"+obj+"3").css("display",'');
				$("#security1").addClass("required");
				
			}else{
				$("#"+obj+"2").css("display",'none');
				$("#"+obj+"3").css("display",'none');
				$("#security1").removeClass("required");
				$("#security1").val('');
			}
		}
		else if(obj=="is_jszyjg"){
			var value=$("#"+obj+"_value").val();
			if(value=='01'){
				$("#"+obj+"2").css("display",'');
				$("#"+obj+"3").css("display",'');
			//	alert($("#is_jszyjglx").find("option:selected").text());
				$("#is_jszyjglx option:first").attr("selected","selected");
				$("#is_jszyjglx_value").addClass("required");
				
			}else{
				$("#"+obj+"2").css("display",'none');
				$("#"+obj+"3").css("display",'none');
				$("#is_jszyjglx_value").val('');
				$("#is_jszyjglx_name").val('');
				$("#is_jszyjglx option:first").attr("selected", "selected");
				//alert($("#is_jszyjglx option:eq(3)").val());
				$("#is_jszyjglx_value").removeClass("required");
				$("#other").val('');
				setZQDMtatus("is_jszyjglx");
			}
		}else if(obj=="is_jszyjglx"){
			var value=$("#"+obj+"_value").val();
			if(value=='08'){
				$("#"+obj+"2").css("display",'');
				$("#"+obj+"3").css("display",'');
				$("#other").addClass("required");
			}else{
				$("#"+obj+"2").css("display",'none');
				$("#"+obj+"3").css("display",'none');
				$("#other").removeClass("required");
				$("#other").val('');
			}
		}else if(obj=="is_jszyjg_my"){
			var value=$("#"+obj+"_value").val();
			if(value=='01'){
				$("#"+obj+"2").css("display",'');
				$("#"+obj+"3").css("display",'');
			//	alert($("#is_jszyjg_mylx").find("option:selected").text());
				$("#is_jszyjg_mylx option:first").attr("selected","selected");
				$("#is_jszyjg_mylx_value").addClass("required");
				
			}else{
				$("#"+obj+"2").css("display",'none');
				$("#"+obj+"3").css("display",'none');
				$("#is_jszyjg_mylx_value").val('');
				$("#is_jszyjg_mylx_name").val('');
				$("#is_jszyjg_mylx option:first").attr("selected", "selected");
				//alert($("#is_jszyjg_mylx option:eq(3)").val());
				$("#is_jszyjg_mylx_value").removeClass("required");
				$("#other1").val('');
				setZQDMtatus("is_jszyjg_mylx");
			}
		}else if(obj=="is_jszyjg_mylx"){
			var value=$("#"+obj+"_value").val();
			if(value=='08'){
				$("#"+obj+"2").css("display",'');
				$("#"+obj+"3").css("display",'');
				$("#other1").addClass("required");
			}else{
				$("#"+obj+"2").css("display",'none');
				$("#"+obj+"3").css("display",'none');
				$("#other1").removeClass("required");
				$("#other1").val('');
			}
		}
		else{
			var value=$("#"+obj+"_value").val();
			if(value=='01'){
				$("#"+obj+"2").css("display",'');
				$("#"+obj+"4").css("display",'');
				$("#"+obj+"5").css("display",'');
				$("#"+obj+"3").addClass("required");
			}else{
				$("#"+obj+"2").css("display",'none');
				$("#"+obj+"4").css("display",'none');
				$("#"+obj+"5").css("display",'none');
				$("#"+obj+"4").val('');
				$("#"+obj+"3").val('');
				$("#"+obj+"3").removeClass("required");
			}
		}
	}
	function setDropTextValue(obj)
	{
		var strname = obj.name;
		var objt = document.getElementById(strname+"_name");
		if(!objt) return;

		if(objt.type&&obj.type=='select-one')
		{
			if(obj.selectedIndex==-1)
			{
				setTagValue(objt,"");
			}
			else
			{ 
				//stms-1864 修复:chrome/firefox点击父页面的"附件管理",新上传附件文件后,附件类型丢失  [wdd 2013-7-8]
				obj.options[obj.selectedIndex].setAttribute("selected",true);
				setTagValue(objt,obj.options[obj.selectedIndex].text);
			}
		}
	}
</script>